/*认证信息*/
//获取认证信息详情
function getAuthenticationDetailPro(id) {
    return new Promise(
        (resolve, reject) => {
            var params = {
                id: id
            }
            web.doAjax(root.approvedServiceProviders.getProviderBaseById, 'post',params, function (data) {
                console.log(data)
                if(data.code == 0){
                    resolve(data.data);
                }else {
                    reject(data);
                }
            },2);
        }
    );
}
/*财务信息*/
//获取财务信息
function getFinancialDetailPro(providerId) {
    return new Promise(
        (resolve, reject) => {
            var params = {
                providerId: providerId
            }
            web.doAjax(root.approvedServiceProviders.getProviderFinanceByProviderId, 'post',params, function (data) {
                console.log(data)
                if(data.code == 0){
                    resolve(data.data);
                }else {
                    reject(data);
                }
            },2);
        }
    );
}
/*合作信息*/
//获取合作信息
function getCooperationDetailPro(providerId){
    return new Promise(
        (resolve, reject) => {
            var params = {
                providerId: providerId,
                pageSize: 100,
                pageNumber: 1,
            }
            web.doAjax(root.approvedServiceProviders.findProviderCooperationByPage, 'post',params, function (data) {
                console.log(data)
                if(data.code == 0){
                    resolve(data.result);
                }else {
                    reject(data);
                }
            },2);
        }
    );
}
/*合同信息*/
function getContractDetailPro(providerId) {
    return new Promise(
        (resolve, reject) => {
            var params = {
                providerId: providerId,
            }
            web.doAjax(root.approvedServiceProviders.getProviderContractByProviderId, 'post',params, function (data) {
                console.log(data)
                if(data.code == 0){
                    resolve(data.data);
                }else {
                    reject(data);
                }
            },2);
        }
    );
}
/*查看图片*/
function imgShow(el) {
    var imgUrl = $(el).attr("imgurldata");
    if(imgUrl&&imgUrl!=""){
        var index = layer.open({
            type: 2,
            title: "查看图片",
            content: "../imgShow.html?imgUrl="+imgUrl,
            area: ['800px', '500px'],
            offset: ['100px', '100px']
        });
    }
}
/*取消编辑效果*/
function cancleEditFn(pageName) {
    pageShowFn(pageName)
}
/*tab切换页面变化*/
function pageShowFn(pageName) {
    switch (pageName) {
        case 'authenticationInfoDetail':
            $(".form-box").load("detailPackage/authenticationInfoDetail.html");
            break;
        case 'financialInfoDetail':
            $(".form-box").load("detailPackage/financialInfoDetail.html");
            break;
        case 'cooperationInfoDetail':
            $(".form-box").load("detailPackage/cooperationInfoDetail.html");
            break;
        case 'contractInfoDetail':
            $(".form-box").load("detailPackage/contractInfoDetail.html");
            break;
        default:
            $(".form-box").load("detailPackage/authenticationInfoDetail.html");
            break;
    }
}